

//
//  ZYHomeWorkManagerCell.m
//  优学荟管理系统
//
//  Created by Ethan on 2017/9/22.
//  Copyright © 2017年 星道三好. All rights reserved.
//

#import "ZYHomeWorkManagerCell.h"

@implementation ZYHomeWorkManagerCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setUpSuperView];
    }
    
    
    return self;
}


- (void)setUpSuperView{
    
    
    UIView *allView = [UIView new];
    [self.contentView addSubview:allView];
    UIImageView *photoImageView = [UIImageView new];
    photoImageView.image = [UIImage imageNamed:@"bg_work_default"];
    [allView addSubview:photoImageView];
    
    self.photoButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
  
    [allView addSubview:self.photoButton];
    
    self.homeWorkLabel = [UILabel new];

    [allView addSubview:self.homeWorkLabel];
    
    [allView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.top.offset(0);
        make.width.offset(SCREEN_WIDTH);
        make.height.offset(70);
        
        
    }];
    
    [photoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.offset(0);
        make.width.equalTo(allView);
        make.height.equalTo(allView);
    }];
    
    
    [self.photoButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(22);
        make.centerY.equalTo(allView);
    }];
    

    [self.homeWorkLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.photoButton.mas_right).offset(15);
        make.top.centerY.equalTo(self.photoButton);
    }];
    
    
    UILabel *grayLabel = [UILabel  new];
    grayLabel.backgroundColor = ColorRGB(247, 245, 245);
    [self.contentView addSubview:grayLabel];
    
    
    
    [grayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.offset(0);
        make.top.equalTo(allView.mas_bottom).offset(0);
        make.width.offset(SCREEN_WIDTH);
        make.height.offset(15);
        
    }];
    
    
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.edges.offset(0);
        make.bottom.mas_equalTo(grayLabel).offset(-5);
        
        
    }];
    
   
    
    
    
    

    
    
    
    
}







@end
